#include <stdlib.h>
#include <stdio.h>

#define p_x 10
#define p_y 5
#define X 20
#define Y 20

#define CLEAR() printf("\033[2J")
#define MOVEUP(x) printf("\033[%dA", (x))
#define MOVEDOWN(x) printf("\033[%dB", (x))
#define MOVELEFT(y) printf("\033[%dD", (y))
#define MOVERIGHT(y) printf("\033[%dC", (y))
#define MOVETO(x, y) printf("\033[%d;%dH", (x), (y))
#define RESET_CURSOR() printf("\033[H")
#define HIDE_CURSOR() printf("\033[?251")
#define SHOW_CURSOR() printf("\033[?25h")
#define HIGHT_LIGHT() printf("\033[7m")
#define UN_HIGHT_LIGHT() printf("\033[27m")

int main(int argc, char *argv[])
{
    int x, y;
    CLEAR();
    MOVETO(p_y + 10, p_x + 25);
    printf("\033[32mSCORE: \33[0m");
    MOVETO(p_y + 14, p_x + 25);
    printf("\033[32mLEVEL: \33[0m");
    for (x = p_x, y = p_y; x <= 46; x++)
    {
        MOVETO(y, x);
        printf("\33[41m==\33[0m");
    }
    for (x = p_x, y = p_y + 1; y <= 25; y++)
    {
        MOVETO(y, x);
        printf("\33[41m||\33[0m");
    }
    for (x = p_x + 22, y = p_y + 1; y <= 25; y++)
    {
        MOVETO(y, x);
        printf("\33[41m||\33[0m");
    }
    for (x = p_x + 36, y = p_y + 1; y <= 25; y++)
    {
        MOVETO(y, x);
        printf("\33[41m||\33[0m");
    }
    for (x = p_x + 24, y = p_y + 8; x <= 44; x++)
    {
        MOVETO(y, x);
        printf("\33[41m--\33[0m");
    }
    for (x = p_x, y = p_y + 21; x <= 46; x++)
    {
        MOVETO(y, x);
        printf("\33[41m==\33[0m");
    }
    HIDE_CURSOR();
    fflush(stdout);
    getchar();
    
    return 0;
}
